home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / cxl52_1.zip / CXLVID.H < prev    next >
C/C++ Source or Header  |  1990-02-17  |  6KB  |  162 lines

  1. /*
  2.    ┌──────────────────────────────────────────────────────────────────────────┐
  3.    │                                                                          │
  4.    │  CXLVID.H  -  CXL is Copyright (c) 1987-1990 by Mike Smedley.            │
  5.    │                                                                          │
  6.    │  This header file contains function prototypes and definitions for       │
  7.    │  screen/video functions.  Windowing functions are defined in CXLWIN.H    │
  8.    │                                                                          │
  9.    └──────────────────────────────────────────────────────────────────────────┘
  10. */
  11.  
  12. #if defined(__TURBOC__)                     /* Turbo C */
  13.     #if __STDC__
  14.         #define _Cdecl
  15.     #else
  16.         #define _Cdecl  cdecl
  17.     #endif
  18.     #define _Near
  19. #elif defined(__ZTC__)                      /* Zortech C++ */
  20.     #define _Cdecl
  21.     #define _Near
  22. #elif defined(M_I86) && !defined(__ZTC__)   /* Microsoft C/QuickC */
  23.     #if !defined(NO_EXT_KEYS)
  24.         #define _Cdecl  cdecl
  25.         #define _Near   near
  26.     #else
  27.         #define _Cdecl
  28.         #define _Near
  29.     #endif
  30. #endif
  31.  
  32. /*---------------------------[ function prototypes ]-------------------------*/
  33.  
  34. void     _Cdecl box_(int srow,int scol,int erow,int ecol,int btype,int attr);
  35. void     _Cdecl cclrscrn(int attr);
  36. int      _Cdecl cgardbyte(char far *src);
  37. int      _Cdecl cgardword(int far *src);
  38. void     _Cdecl cgareadn(int far *src,int *dest,unsigned n);
  39. void     _Cdecl cgawrbyte(char far *dest,int chr);
  40. void     _Cdecl cgawriten(int *src,int far *dest,unsigned n);
  41. void     _Cdecl cgawrstr(char far *dest,char *string,int attr);
  42. void     _Cdecl cgawrword(int far *dest,int chratr);
  43. void     _Cdecl clreol_(void);
  44. void     _Cdecl clrscrn(void);
  45. int      _Cdecl disktoscrn(char *fname);
  46. int      _Cdecl disktowin(char *fname);
  47. void     _Cdecl fill_(int srow,int scol,int erow,int ecol,int ch,int atr);
  48. void     _Cdecl getcursz(int *sline,int *eline);
  49. void     _Cdecl gotoxy_(int row,int col);
  50. void     _Cdecl hidecur(void);
  51. void     _Cdecl lgcursor(void);
  52. int      _Cdecl mapattr(int attr);
  53. void     _Cdecl mode(int mode_code);
  54. void     _Cdecl printc(int row,int col,int attr,int ch);
  55. void     _Cdecl prints(int row,int col,int attr,char *str);
  56. void     _Cdecl putchat(int ch,int attr);
  57. unsigned _Cdecl readchat(void);
  58. void     _Cdecl readcur(int *row,int *col);
  59. void     _Cdecl revattr(int count);
  60. int      _Cdecl revsattr(int attr);
  61. int      _Cdecl scrntodisk(char *fname);
  62. void     _Cdecl setattr(int attr,int count);
  63. void     _Cdecl setcursz(int sline,int eline);
  64. int      _Cdecl setlines(int numlines);
  65. int      _Cdecl setvparam(int setting);
  66. void     _Cdecl showcur(void);
  67. void     _Cdecl smcursor(void);
  68. void     _Cdecl spc(int num);
  69. void     _Cdecl srestore(int *sbuf);
  70. int     *_Cdecl ssave(void);
  71. int      _Cdecl videoinit(void);
  72. int      _Cdecl vidmode(void);
  73. int      _Cdecl vidtype(void);
  74. int      _Cdecl wintodisk(int srow,int scol,int erow,int ecol,char *fname);
  75.  
  76. /*-------------[ display adapter types returned from vidtype() ]-------------*/
  77.  
  78. #define V_NONE      0
  79. #define V_MDA       1
  80. #define V_EGAMONO   2
  81. #define V_MCGAMONO  3
  82. #define V_VGAMONO   4
  83. #define V_HGC       5
  84. #define V_HGCPLUS   6
  85. #define V_INCOLOR   7
  86. #define V_CGA       8
  87. #define V_EGA       9
  88. #define V_MCGA      10
  89. #define V_VGA       11
  90.  
  91. /*------------------------[ video parameter settings ]-----------------------*/
  92.  
  93. #define VP_DMA    0     /* direct screen writes                     */
  94. #define VP_CGA    1     /* direct screen writes, eliminate CGA snow */
  95. #define VP_BIOS   2     /* BIOS screen writes                       */
  96. #define VP_MONO   3     /* monochrome attribute translation on      */
  97. #define VP_COLOR  4     /* monochrome attribute translation off     */
  98.  
  99. /*------------------------[ video information record ]-----------------------*/
  100.  
  101. struct _vinfo_t {
  102.     unsigned int    videoseg;   /* video buffer segment address */
  103.     unsigned char   adapter;    /* video adapter type           */
  104.     unsigned char   numrows;    /* number of displayed rows     */
  105.     unsigned char   numcols;    /* number of displayed columns  */
  106.     unsigned char   cheight;    /* character height in pixels   */
  107.     unsigned char   cwidth;     /* character width  in pixels   */
  108.     unsigned char   mono;       /* is it a monochrome adapter?  */
  109.     unsigned char   mapattr;    /* map color attribs to mono?   */
  110.     unsigned char   cgasnow;    /* is CGA snow present?         */
  111.     unsigned char   usebios;    /* use BIOS for video writes?   */
  112.     unsigned char   dvcheck;    /* check for DESQview?          */
  113.     unsigned char   dvexist;    /* is DESQview present?         */
  114. };
  115.  
  116. extern struct _vinfo_t _Near _Cdecl _vinfo;
  117.  
  118. /*--------------[ attribute codes for functions that use them ]--------------*/
  119.  
  120. #if     !defined(BLACK)     /* foreground colors */
  121. #define BLACK       0                   
  122. #define BLUE        1
  123. #define GREEN       2
  124. #define CYAN        3
  125. #define RED         4
  126. #define MAGENTA     5
  127. #define BROWN       6
  128. #define YELLOW      14
  129. #define WHITE       15
  130. #endif
  131. #if     !defined(LGREY)
  132. #define LGREY       7       /* CXL abbreviates LIGHT as L    */
  133. #define DGREY       8       /* and DARK as D for ease of use */
  134. #define LBLUE       9
  135. #define LGREEN      10
  136. #define LCYAN       11
  137. #define LRED        12
  138. #define LMAGENTA    13
  139.  
  140. #define _BLACK      0       /* background colors */
  141. #define _BLUE       16
  142. #define _GREEN      32
  143. #define _CYAN       48
  144. #define _RED        64
  145. #define _MAGENTA    80
  146. #define _BROWN      96
  147. #define _LGREY      112
  148. #endif
  149.  
  150. #if     !defined(BLINK)
  151. #define BLINK       128     /* blink attribute */
  152. #endif
  153.  
  154. /*-----------------------[ macro-function definitions ]----------------------*/
  155.  
  156. #if !defined(MK_FP)
  157. #define MK_FP(seg,ofs)      ((void far *) (((unsigned long)(seg) << 16) | \
  158.                             (unsigned)(ofs)))
  159. #endif
  160. #define attrib(f,b,i,bl)    ((b<<4)|(f)|(i<<3)|(bl<<7))
  161. #define clrwin(a,b,c,d)     gotoxy_(a,b);fill_(a,b,c,d,' ',(readchat()>>8))
  162.